<template>
  <div class="imgaa">
    <img src="../../assets/1.png" alt="">
  </div>
  <div class="row">
    <div class="col-4">
      <div class="asd">
        <router-link to="AdminMain">
          未审核
        </router-link>
      </div>
    </div>

    <div class="col-4">
      <div class="abd">
        <router-link to="Finished">
          已审核
        </router-link>
      </div>
    </div>

    <div class="col-4">
      <button @click="request.get('admin/logout').then(()=>router.push('admin'))" class="btn btn-outline-danger" style="width: 30%">退出</button>
    </div>
  </div>
  <div class="container-fluid">

    <div class="row" style=" margin-top:3%">
      <div class="col-2">
      </div>
      <div class="col-8">
        <div class="row">
          <div class="col-6" v-for="(i,x) in checkedVideo" :key="x">
            <div class="card mb-3" style="max-width: 100%;">
              <div class="row g-0">
                <div class="col-md-6">
                  <img :src="request.pic(i.video.cover_pic)" class="img-fluid rounded-start" alt="...">
                </div>
                <div class="col-md-6">
                  <div class="card-body" style="padding-top: 10%">
                    <h6 class="card-title bcad">视频标题:{{i.video.title}}</h6>
                    <p class="card-text"><small class="text-muted">作者: {{i.video.uuid}}</small></p>
                    <p class="card-text"><small class="text-muted">上传时间: {{i.video.up_time.slice(0,10)}}</small></p>
                    <p class="card-text"><small class="text-muted">审核时间: {{i.time.slice(0,10)}}</small></p>
                    <p class="card-text"><small :class="i.pass?'text-muted':'text-danger'">状态: {{i.pass?'审核通过':'审核不通过'}}</small></p>
                  </div>
                </div>
              </div>
            </div>
          </div>
<!--          <div class="col-6" style="">
            <div class="card mb-3" style="max-width: 100%;">
              <div class="row g-0">
                <div class="col-md-6">
                  <img src="1.jpeg" class="img-fluid rounded-start" alt="...">
                </div>
                <div class="col-md-6">
                  <div class="card-body" style="padding-top: 10%">
                    <h6 class="card-title bcad">视频标题:</h6>
                    <p class="card-text"><small class="text-muted">作者: </small></p>
                    <p class="card-text"><small class="text-muted">上传时间: </small></p>
                    <p class="card-text"><small class="text-muted">审核时间: </small></p>
                    <p class="card-text"><small class="text-muted">状态: </small></p>
                  </div>
                </div>
              </div>
            </div>
          </div>-->
        </div>
<!--        <div class="row">
          <div class="col-6">
            <div class="card mb-3" style="max-width: 100%;">
              <div class="row g-0">
                <div class="col-md-6">
                  <img src="1.jpeg" class="img-fluid rounded-start" alt="...">
                </div>
                <div class="col-md-6">
                  <div class="card-body" style="padding-top: 10%">
                    <h6 class="card-title bcad">视频标题:</h6>
                    <p class="card-text"><small class="text-muted">作者: </small></p>
                    <p class="card-text"><small class="text-muted">上传时间: </small></p>
                    <p class="card-text"><small class="text-muted">审核时间: </small></p>
                    <p class="card-text"><small class="text-muted">状态: </small></p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-6" style="">
            <div class="card mb-3" style="max-width: 100%;">
              <div class="row g-0">
                <div class="col-md-6">
                  <img src="1.jpeg" class="img-fluid rounded-start" alt="...">
                </div>
                <div class="col-md-6">
                  <div class="card-body" style="padding-top: 10%">
                    <h6 class="card-title bcad">视频标题:</h6>
                    <p class="card-text"><small class="text-muted">作者: </small></p>
                    <p class="card-text"><small class="text-muted">上传时间: </small></p>
                    <p class="card-text"><small class="text-muted">审核时间: </small></p>
                    <p class="card-text"><small class="text-muted">状态: </small></p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>-->
        <div aria-label="Page navigation example" style="padding-left: 15%;padding-top: 3%" v-if="false">
          <ul class="pagination pagination-centered">
            <li class="page-item"><a class="page-link" href="#">上一页</a></li>
            <li class="page-item"><a class="page-link" href="#">1</a></li>
            <li class="page-item"><a class="page-link" href="#">2</a></li>
            <li class="page-item"><a class="page-link" href="#">3</a></li>
            <li class="page-item"><a class="page-link" href="#">4</a></li>
            <li class="page-item"><a class="page-link" href="#">5</a></li>
            <li class="page-item"><a class="page-link" href="#">6</a></li>
            <li class="page-item"><a class="page-link" href="#">7</a></li>
            <li class="page-item"><a class="page-link" href="#">8</a></li>
            <li class="page-item"><a class="page-link" href="#">9</a></li>
            <li class="page-item"><a class="page-link" href="#">10</a></li>
            <li class="page-item"><a class="page-link" href="#">11</a></li>
            <li class="page-item"><a class="page-link" href="#">下一页</a></li>
          </ul>
        </div>
      </div>
      <div class="col-2">
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import {router} from "@/router";
import request from "@/hooks/request";
import {computed, ref} from "vue";
import {AdminVideo} from "@/types/AllData";

const checkedVideo=ref<AdminVideo[]>([])
request.get('admin/current').then(re=>{
  if (!re){
    confirm('请登录')
    router.push('admin')
  }
})
request.get('admin/get_checked_result').then(re=>{
  checkedVideo.value=re
}).catch(reason => {
  confirm('请登录')
  router.push('admin')
})
</script>
<style src="../../assets/css/finished.css" scoped/>
<style src="../../assets/css/audit.css" scoped/>
<style scoped>

</style>